<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>提交订单</title> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="${resources}/plugins/fontAwesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <link href="${resources}/css/common.css" rel="stylesheet" type="text/css">
    <link href="${resources}/css/submitOrder.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
    <div class="commonHeader">商品详情</div>

	<div id="wrapper">
		<ul class="goodsList">
		<#list cartItemList as goods>
			<li class="goods">
				<a href="javascript:void (0)">
					<div class="goodsImg"><img src="${goods.goods.picurl}" alt=""></div>
					<h3 class="goodsName">${goods.goods.name}</h3>
					<div class="integral">${goods.amount*(goods.goods.price*merchantRate.score)}积分</div>
				</a>
			</li>
		</#list>   
		</ul>

		<ul class="list">
			<li>
				<p>您绑定的手机号码</p>
				<p class="bandPhone" href="javascript:void(0)">
					<span>${membership.member.username}</span>
				  <#if membership.member.username == null>
                      <span>未绑定</span>
				      <a class="pullRight bind">绑定新号码 <span class="fa fa-angle-right"></span></a>
				  </#if>
				</p>
			</li>
			<li>
				<a href="javascript:void (0)">
					<p>
						<span>${address.name}</span>
						<span class="pullRight">${address.telephone}</span>
					</p>
					<p>${address.address}</p>
				</a>
			</li>
		</ul>
	</div>
<form class="form-horizontal" id="validation-form" method="post" action="${path}/manage/score/cart/submitOrder" >
    <div class="submitOrder">总计：${totalscore}积分  
       <input type = "hidden" id="addressid" name="addressid" value="${address.id}">
        <a href="javascript:void (0)" class="submit" id="submitOrder" >提交订单</a> 
    </div>
</form>    
</div>
<script src="${resources}/js/jquery-2.2.2.min.js"></script>
<script src="${resources}/js/common.js"></script>
<script src="${resources}/js/submitOrder.js"></script>
<script>
var path = "${path}";
 
   $("#submitOrder").click(function(){ 
      
     if('${membership.member.username}'==''){
      common.alert({content:"请绑定手机号码"});
         return false;
       } 
  
      if($("#addressid").val()<0){
         common.alert({content:"请选择收货地址"});
         return false;
      }
    
      if(parseFloat('${membership.account.score}')<parseFloat('${totalscore}')){
           common.alert({content:"您的积分不足"});
           return false;
        } 
  
		  common.alert({
						width	:	"85%",
						title	:	"提示",
						content	:	"是否消费${totalscore}积分",
					dialog	:	true,
					ok:function(){ 
					    $("#validation-form").submit(); 
					},
					cancel:function(){
						
						
					}
				}) 
         
   });
  
</script>
</body>
</html>